package com.banksoft.admin.service.impl;

import com.banksoft.admin.dao.AmountLogDao;
import com.banksoft.admin.entity.AmountLog;
import com.banksoft.admin.service.AmoutLogService;
import com.banksoft.front.bean.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by vanjoger on 2017/1/5.
 */
@Service
public class AmountLogServiceImpl implements AmoutLogService {

    @Autowired
    AmountLogDao amountLogDao;


    @Override
    public List<AmountLog> query(Map map) {
        return this.amountLogDao.query(map);
    }

    @Override
    public Page queryPage(Map map, int pageNo, int pageSize) {
        Page page = new Page(pageNo,pageSize);
        map.put("start",page.getStart());
        map.put("size",pageSize);

        List<AmountLog> list = this.amountLogDao.queryPage(map);
        Integer total = this.amountLogDao.countPage(map);
        page.setData(list);
        page.setTotal(total);
        return page;
    }
}
